home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20000217-20000824 / 000041_news@columbia.edu _Wed Feb 23 14:10:31 2000.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id OAA10375
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Wed, 23 Feb 2000 14:10:30 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id OAA24811
  7.     for kermit.misc@watsun.cc.columbia.edu; Wed, 23 Feb 2000 14:03:02 -0500 (EST)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: jrd@cc.usu.edu (Joe Doupnik)
  10. Subject: Re: Array name passed to macro as argument?
  11. Message-ID: <Jf10IGSklAzn@cc.usu.edu>
  12. Date: 23 Feb 00 11:52:16 MDT
  13. Organization: Utah State University
  14. To: kermit.misc@columbia.edu
  15.  
  16. In article <891805$ltt$1@newsmaster.cc.columbia.edu>, fdc@watsun.cc.columbia.edu (Frank da Cruz) writes:
  17. > In article <8915uc$4e2$1@nnrp1.deja.com>,
  18. > Peter Easthope  <peter_easthope@gulfnet.pinc.com> wrote:
  19. > : In <88u9fb$ev5$1@newsmaster.cc.columbia.edu>
  20. > : posted at 22 Feb 2000 15:20:11 GMT Frank da Cruz said,
  21. > : fdc> ... in C-Kermit 7.0 / K95 1.1.19, you can write this more
  22. > : simply ... declare \&d[] = Sea urchin.
  23. > : 
  24. > : Thanks Frank.  It is in my memory banks for future
  25. > : use.  The current application is meant to run on MS-DOS
  26. > : Kermit also; for now I will retain the more primitive
  27. > : notation to declare the array.
  28. > : 
  29. > : fdc> Here's a version of your Test macro that works:
  30. > : 
  31. > :   def test {
  32. > :     local \%x
  33. > :     .\%x := \\&\%1[1]
  34. > :     echo {\%x}
  35. > :     .\%x := \\&\%1[2]
  36. > :     echo {\%x}
  37. > :   }
  38. > : 
  39. > : MS-DOS Kermit complains: "?More parameters are needed".
  40. > : 
  41. > : What does the "." in ".\%x" mean?  What
  42. > : documentation is recommended for these details?
  43. > : 
  44. > That's a new "programmer friendly" assignment notation, but
  45. > it only works in K95 and C-Kermit.
  46. > OK, here's another way that works in MS-DOS Kermit 3.15, as
  47. > well as in K95 and C-Kermit:
  48. >   def arraytest {                ; Define macro
  49. >     local \%x
  50. >     assign \%x \\\%1[1]
  51. >     echo {\%x}
  52. >     assign \%x \\\%1[2]
  53. >     echo {\%x}
  54. >   }
  55. >   declare \&a[10]                 ; Set up array
  56. >   assign \&a[1] one
  57. >   assign \&a[2] two
  58. >   assign \&a[3] three
  59. >   arraytest &a                    ; Call macro with array name.
  60. > Note that TEST is a built-in command in MS-DOS Kermit.  Backslash
  61. > craziness is avoided by passing the array name to the macro sans
  62. > backslash.  The statement:
  63. >   assign \%x \\\%1[1]
  64. > constructs the string \&a[1] and assigns it to \%x.
  65. > - Frank
  66. -------
  67.     Just a comment from the trenches on this item. The fancier notation
  68. used by Frank is nifty. However when it comes to implementing it in assembler
  69. within a small space for a DOS program and inside of especially complex
  70. code for parsing, then things are sticky. Thus I decided to not implement
  71. the dot semicolon-equal etc material as there are equivalent ways of 
  72. accomplishing the goal. Appologies for the inconvience of having two ways
  73. of doing this.
  74.     Joe D.